<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js基本类型</title>
</head>
<body>
    
</body>
<script>
    // 数字
    var shuzi = 1;
    console.log(typeof shuzi)

    // 字符串
    var str = '1';
    console.log(typeof str);

    // null：数据不确定类型时
    var kong = null;
    console.log(typeof kong);
    kong = 10;
    console.log(kong);

    // 未定义 undefined
    var buqueding;
    console.log(typeof buqueding);
    buqueding = '10';
    console.log(buqueding);

    // 数组
    var arr = [];
    console.log(typeof arr);
    arr[0] = 1;
    console.log(arr);
    arr.push(2);
    console.log(arr);
    arr.unshift(0);
    console.log(arr);
    arr.pop();
    console.log(arr);
    arr.shift();
    console.log(arr);

    // 对象
    var person = {};
    console.log(typeof person);
    person.name = '郑君全';
    console.log(person);
    person.age = 18;
    console.log(person);
    person.job = function(){
        console.log('写代码！');
    };
    console.log(person);
</script>
</html>